package com.nolf.learn.anagrams;

import java.io.File;
import java.io.IOException;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import org.apache.commons.io.FileUtils;

public class SetupDictionary {

	private final static String DICTIONARY_PATH = "./data/dictionary.words";
	
	public static Set<String> loadDictionary() {
		try {
			List<String> words = FileUtils.readLines(new File(DICTIONARY_PATH));
			return new HashSet<String>(words);			
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		return null;
	}
	
	public static void main(String [] args) {
		Set<String> dic = loadDictionary();
		System.out.println(dic.size());
	}
	
}
